import request from "../../utils/request.ts";
import { message } from 'antd';
import type { AxiosResponse } from 'axios'


export const getDoctorList = async (params: any): Promise<AxiosResponse> => {
    try {
        const res: AxiosResponse<any, any> = await request.get('/doctor/list_doctor', params)
        if (res.data.code === 1) {
            return res.data
        }
        message.error(res.data.msg)
    } catch (err) {
        throw err
    }
}

export const getDoctorSerach = async (params: any): Promise<AxiosResponse> => {
    try {
        const res: AxiosResponse<any, any> = await request.get('/doctor/search_doctor', params)
        if (res.data.code === 1) {
            return res.data
        }
        message.error(res.data.msg)
    } catch (err) {
        throw err
    }
}